#include<iostream>
#include"shared_ptr.hpp"

int main()
{
	int* k = new int(1);

	shared_ptr<int> t1(k);
	(* t1)++;
	std::cout << "K : " << *k <<std::endl;
	std::cout << "cnt : " << t1.use_count() << std::endl;


	shared_ptr<int> t2(t1);
	(*t2)++;
	std::cout << "K : " << *k << std::endl;
	std::cout << "cnt : " << t2.use_count() << std::endl;

	//std::function<void(int*)> _del = [](int* ptr) {
	//	std::cout << "delete" << std::endl;
	//	delete ptr; };
	//shared_ptr<int> t3(k, _del);
	//std::cout << "K : " << *k << std::endl;
	//std::cout << "cnt : " << t3.use_count() << std::endl;

	return 0;
}







